package top.lingkang.acgv.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.lingkang.acgv.acr.entity.Role;
import top.lingkang.acgv.acr.entity.User;
import top.lingkang.acgv.mapper.RoleMapper;
import top.lingkang.acgv.mapper.UserMapper;
import top.lingkang.acgv.service.UserService;

import java.util.List;

/**
 * @author lingkang
 * @date 2021/7/30 9:47
 * @description
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Autowired
    private RoleMapper roleMapper;

    public User getUser(String username) {
        return userMapper.get(username);
    }

    public List<Role> getRoleList(Integer userId) {
        return roleMapper.getRolesByUserid(userId);
    }
}
